//create opengl context for windows
//just test , failed to integrate in the plugin, this block dumped

#ifndef GLCONTEXTMAYA
#define GLCONTEXTMAYA
//#include <Windows.h>
#include <maya/MGlobal.h>//window.h is included in this headfile

class openglContextMaya
{
public:
	openglContextMaya() { dcReset(); }
	~openglContextMaya() { dcPurge(); }

	//MStatus dcInitialize();
	void dcInitialize();
	void openglSetPixelFormat();

	void dcPurge()
	{
		if (newHDC)
		{
			//wglMakeCurrent(NULL, NULL);
			wglMakeCurrent(oldHDC, oldHRC);
			wglDeleteContext(newHRC);
			
		}
		dcReset();
	}

private:

	void dcReset()
	{
		newHDC = NULL;
		oldHDC = NULL;
		newHRC = NULL;
		oldHDC = NULL;
	}

	HDC newHDC, oldHDC;
	HGLRC newHRC,oldHRC;

};

#endif